<template>
    <div class="main">
        <div class="head">
            <div class="head-left"><i @click="turn()" class="iconfont icon-msnui-left-arrow-round"></i></div>
            <div class="input"><i class="iconfont icon-sousuo"></i>搜索医严堂内容或健康号</div>
            <i class="iconfont icon-xinxi" style="font-size: 20px;padding-right: 0.1rem"></i>
        </div>
        <div class="content">
            <div class="ban">
                <div class="item" @click="show(index)" v-for="(n,index) in data.List" >
                    <img class="img" :src="n.IndexImgUrl"><p class="p">{{n .IndexTitle}}</p>
                </div>
            </div>
            <div class="navlist">
                <div class="nav" v-for="s in AllTalk"><img class="img" :src="s.AllTalkImgUrl">{{s.AllTalkTitle}}</div>
            </div>
            <div class="tab">
                <ul class="tabpanel">
                    <li class="li active">精选推荐<b class="b"></b></li>
                    <li class="li ">我关注的<b class="b"></b></li>
                </ul>
                <div class="luntan">
                    <div class="main1">
                        <div class="luntan-header">
                            <img class="img" :src="Select.SelectUserTouXiang">
                            <div class="luntan-r">
                                <div class="title">
                                    <p class="p-t">{{Select.SelectUserTitle}}<span class="span">{{Select.SelectUserWork}}</span></p>
                                    <p class="p-c">{{Select.SelectUserTime}}</p>
                                </div>
                                <div class="p-r">关注</div>
                            </div>
                        </div>
                        <div class="luntan-content active" >
                            <img class="img" src="/static/img/yiyantang/5.jpg">
                            <p class="p">{{Select.DieaseTitle}}</p>
                            <p class="post">{{Select.DieaseContent}}</p>
                            <img class="imglast" :src="Select.DieaseImgUrl">
                        </div>
                    </div>

                    <div class="main2" style="display: none">
                        <div class="luntan-header">
                            <img class="img" :src="Focus.FocusTouXiang">
                            <div class="luntan-r">
                                <div class="title">
                                    <p class="p-t">{{Focus.FocusUserTitle}}<span class="span">{{Focus.FocusUserWork}}</span></p>
                                    <p class="p-c">{{Focus.DieaseTitle}}</p>
                                </div>
                                <div class="p-r">关注</div>
                            </div>
                        </div>
                        <div class="luntan-content">
                            <img class="img" src="/static/img/yiyantang/5.jpg">
                            <p class="p">{{Focus.DieaseTitle}}</p>
                            <p class="post">{{Focus.DieaseContent}}</p>
                            <img class="imglast" :src="Focus.DieaseImgUrl">
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <foot></foot>
    </div>
</template>
<script>
    import Foot from "../components/YiYanTang/Foot"
    export default {
        data:function () {
          return{
              data:[],
              AllTalk:[],
              Select:[],
              Focus:[]
          }
        },
        methods:{
            show:function (index) {
                this.$router.push(`/list/${index}`);
            },
            turn:function(){
                this.$router.push("/")
            }
        },
        mounted:function () {
            $(".tabpanel li").click(function(){
                $(this).addClass("active").siblings().removeClass("active");
                let iIndex=$(this).index()
                if(iIndex==0){
                    $(".main1").css("display","block")
                    $(".main2").css("display","none")
                }
                else{
                    $(".main1").css("display","none")
                    $(".main2").css("display","block")
                }
            })
        },
        components:{
            Foot
        },
        created:function () {
                fetch("./static/data/data.json").then((response)=>{
                    response.json().then((data)=>{
                        this.data=data[0].kandian[0];
                        this.AllTalk=data[0].kandian[1].AllTalk;
                        this.Select=data[0].kandian[2].Select[0];
                        this.Focus=data[0].kandian[3].Focus[0];
                    })
                })
        }
    }
</script>
<style scoped>
    html,body{
        height: 100%;
    }
    .main{
        height: 100%;
        flex-direction: column;
        display: flex;
        justify-content: space-between;
    }
    .content{
        flex: 1;
        overflow-x: hidden;
        overflow-y: auto;
    }
    .head {
        width: 100%;
        margin: 0.03rem auto;
        height: 0.5rem;
        display: flex;
        justify-content: space-between;
        align-items: center; }
    .head .head-left {
        font-size: 0.15rem; }
    .head .head-left .icon-msnui-left-arrow-round {
        font-size: 0.3rem; }
    .head .input {
        width: 2.7rem;
        height: 0.3rem;
        background: #f5f6f6;
        display: flex;
        align-items: center;
        font-size: 0.12rem;
        color: #a3a7b4;
        text-align: center;
        justify-content: center;
        border-radius: 30px; }
    .head .img {
        width: 0.4rem; }

    .ban {
        width: 3.3rem;
        margin: 0 auto;
        display: flex;
        justify-content: space-between;
        flex-wrap: wrap; }
    .ban .item {
        width: 0.7rem;
        text-align: center;
        margin-top: 0.2rem; }
    .ban .item .img {
        display: block;
        width: 0.49rem;
        margin-left: 0.1rem; }
    .ban .item .p {
        font-size: 0.12rem;
        color: #28354c;
        margin-top: 0.05rem; }

    .navlist {
        display: flex;
        flex-wrap: wrap;
        border-top: 1px solid #eeeeee;
        border-bottom: 1px solid #eeeeee;
        margin-top: 0.1rem; }
    .navlist .nav {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 50%;
        height: 0.4rem; }
    .navlist .nav .img {
        display: block;
        width: 0.17rem;
        margin-right: 0.05rem; }

    .tab .tabpanel {
        height: 0.45rem;
        display: flex;
        border-bottom: 1px solid #eee; }
    .tab .tabpanel .li {
        line-height: 0.45rem;
        width: 50%;
        text-align: center;
        font-size: 0.15rem;
        color: #c1c2cc;
        position: relative; }
    .tab .tabpanel .li .b {
        height: 0.02rem;
        width: 0.16rem;
        background: #007aff;
        position: absolute;
        left: 45%;
        bottom: 0;
        display: none; }
    .tab .tabpanel .active {
        color: #326dff; }
    .tab .tabpanel .active .b {
        display: block; }
    .tab .luntan {
        width: 3.5rem;
        padding-top: 0.14rem;
        margin: 0 auto; }
    .tab .luntan .luntan-header {
        display: flex;
        align-items: center; }
    .tab .luntan .luntan-header .img {
        width: 0.37rem;
        height: 0.32rem; }
    .tab .luntan .luntan-header .luntan-r {
        width: 90%;
        display: flex;
        flex-wrap: wrap;
        justify-content: space-between;
        align-items: center; }
    .tab .luntan .luntan-header .luntan-r .title .p-t {
        font-size: 0.14rem; }
    .tab .luntan .luntan-header .luntan-r .title .p-t .span {
        width: 0.39rem;
        line-height: 0.15rem;
        color: white;
        text-align: center;
        background: #02d081;
        margin-left: 0.05rem;
        border-radius: 0.05rem; }
    .tab .luntan .luntan-header .luntan-r .title .p-c {
        color: #a6a8b6; }
    .tab .luntan .luntan-header .luntan-r .p-r {
        width: 0.56rem;
        line-height: 0.23rem;
        text-align: center;
        color: #3f86ff;
        border-radius: 15px;
        border: 1px solid #3f86ff; }
    .tab .luntan .luntan-content {
        border-bottom: 1px solid #eee;
        margin-bottom: 0.1rem; }
    .tab .luntan .luntan-content .img {
        width: 0.16rem;
        height: 0.16rem;
        display: block;
        float: left;
        margin-top: 0.03rem; }
    .tab .luntan .luntan-content .p {
        font-size: 0.16rem;
        font-weight: bold;
        float: left;
        width: 95%; }
    .tab .luntan .luntan-content .post {
        font-size: 0.15rem;
        color: #83889a;
        margin-top: 0.1rem; }
    .tab .luntan .luntan-content .imglast {
        width: 2.43rem; }



    /*# sourceMappingURL=index.css.map */

</style>
